<template>
  <view class="story" @click="handleItem">
    <u-image
      show-loading
      :show-menu-by-longpress="false"
      :src="item.cover_img"
      width="100%"
      height="224rpx"
      :radius="10"
    />
    <view class="title">{{ item.title }}</view>
    <view class="date">{{ $TimeFormat(new Date(item.create_time),'yyyy.mm.dd') }}</view>
  </view>
</template>
<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  methods: {
    // 点击详情
    handleItem() {
      this.$emit("clickItem", this.item);
    },
  },
};
</script>

<style lang="scss" scoped>
.story {
  display: inline-block;
  width: 100%;
  .title {
    height: 80rpx;
    line-height: 40rpx;
    color: #222222;
    font-weight: 400;
    font-size: 24rpx;
    overflow: hidden;
    display: -webkit-box;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .date {
    text-align: right;
    font-size: 20rpx;
    line-height: 40rpx;
    color: $active-color;
  }
}
</style>
